<template>
  <div class="item-size">
    <div class="head">
      <span class="name">{{size.name}}</span>
      <span class="def" v-if="size.isDefault === 0">默认尺码</span>
      <div class="btn">
        <a @click="$emit('on-edit', size)" href="javascript:;">编辑</a>
        <a @click="$emit('on-delete', size)" class="red" href="javascript:;">删除</a>
      </div>
    </div>
    <div class="body">
      <span>性别： {{size.gender}}</span>
      <span>身高(cm)： {{size.height}}</span>
      <span>体重(kg)： {{size.bodyWeight}}</span>
      <span>肩宽(cm)： {{size.shoulderWidth}}</span>
      <span>胸围(cm)： {{size.chestCircumference}}</span>
      <span>腰围(cm)： {{size.waistCircumference}}</span>
      <span>臀围(cm)： {{size.hips}}</span>
      <span>脚长(cm)： {{size.footSize}}</span>
      <span>脚围(cm)： {{size.footCircumference}}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'SizeItem',
  props: {
    size: {
      type: Object,
      default: () => ({})
    }
  },
  emits: ['on-delete', 'on-edit']
}
</script>

<style lang="less" scoped>
.item-size {
  margin-top: 40px;
  padding: 20px;
  border: 1px solid #f5f5f5;
  &:hover {
    border: 1px dashed #27ba9b;
  }
  .head {
    height: 40px;
    display: flex;
    line-height: 40px;
    span {
      width: 100px;
      text-align: center;
    }
    .name {
      background: #f5f5f5;
    }
    .def {
      color: #ffb302;
    }
    .btn {
      flex: 1;
      text-align: right;
      a {
        color: #27ba9b;
        padding-left: 20px;
      }
      .red {
        color: #cf4444!important;
      }
    }
  }
  .body {
    width: 690px;
    display: flex;
    flex-wrap: wrap;
    margin-top: 10px;
    color: #999;
    span {
    width: 230px;
    line-height: 40px;
    }
  }
}
</style>
